 <{extends file="<{$tempdir}>/public/wxsite.html"}>  
<{block name=extendcss}> 
	<link rel="stylesheet"  href="<{$siteurl}>/templates/<{$tempdir}>/public/wxsite/css/public.css">   
 <link rel="stylesheet"  href="<{$siteurl}>/templates/<{$tempdir}>/public/wxsite/css/shoplist.css">   

 <style>
 .clkitm { min-height: 80px;}
 #cuisien{padding-left:0px;padding-right:0px;margin-left:0px; margin-right:0px;}
 #cuisien li{padding-left:0px;padding-right:0px;margin-left:0px; margin-right:0px;}
 </style>
<{/block}>
<{block name=loadinghide}><{/block}>
  <{block name=extendjs}> 
 <script src="<{$siteurl}>/templates/<{$tempdir}>/public/wxsite/js/template.min.js"></script>     
 <script>
 var pulldowncate;
var can_show = true;
var page = 1;
var catid = <{$typeid|default:0}>;
var order = 0;
var qsjid = 0;
var typeid = <{$typeid|default:0}>;
var myaddress = '<{$myaddress}>';
var search_input = '<{$search_input|default:' '}>';
var shopshowtype  = '<{$shopshowtype}>';
var html5_config = {'showheader':true,'showfooter':true,'bodyscller':true,'Canfresh':true,'CanloadMore':true,'titilename':'外卖频道'}; 


$(function(){ 
 

$('.toptitBox .toptitL').bind("click", function() {    
	    history.back();
   });
 	 loading();
	
	 //加载页面函数
	function loading(){
		if(typeof html5_config == 'undefined'){
			alert('获取失败');
		}else{ 
			
			if(html5_config.bodyscller == true){
				 setTimeout(function(){  
					$('#wrapper').show();    
					 addfresh();
					 
				 },500);
			}
		 
		}
		
	

		
	}
	
	
	if( typeid != '' ){
		$('.kwselected span').html( $(".typeid_"+typeid).attr('catename') );
		
  
			 $(".typeid_"+typeid).addClass('xz').siblings().removeClass('xz');
		   $('#toolbar').find('.se').removeClass('se');
		   $('#toolbar').find('.sh').removeClass('sh');
		   $('#supplierlist').html('');
		
		   $('#toolbar').find('li').eq(0).html('<a>'+ $(".typeid_"+typeid).text()+'<b class=""></b></a>');
		   catid = $(".typeid_"+typeid).attr('id');//alert(this).
		   can_show = true; 
		   page = 1;
		   
		   $(".kouweidiv").hide();
		   
		 
	}
	

	 
 		$('#toolbar .sele>li').bind("click", function() {   
	    $('#toolbar .sele>b').removeClass('se');
     $(this).addClass('se').siblings().removeClass('se');
     $(this).find('b').addClass('se');
      $('#toolbar .sub').addClass('sh');
       var cc = $('#toolbar .sele').find('li').index(this); 
       $('#toolbar .lizd').eq(cc).show().siblings().hide();//('sh'); 
   
      });

 	$('#sorts li').bind("click",function(){
	  $(this).addClass('xz').siblings().removeClass('xz');
	    $('#toolbar').find('.se').removeClass('se');
      $('#toolbar').find('.sh').removeClass('sh'); 
	    $('#toolbar').find('li').eq(2).html('<a>'+$(this).text()+'<b class=""></b></a>');
	    order = $(this).attr('value');
	   $('#supplierlist').html('');
      page = 1;
   	  can_show = true; 
	    freshpage(); 
  });
  $('.lizd li').bind("hover",function(){
	   $(this).addClass('tapclass').siblings().removeClass('tapclass');
  });
  $('#cuisien li').bind('click',function(){

		$('.kwselected span').html( $(this).attr('catename') );
		
  
	   $(this).addClass('xz').siblings().removeClass('xz');
	   $('#toolbar').find('.se').removeClass('se');
	   $('#toolbar').find('.sh').removeClass('sh');
	   $('#supplierlist').html('');
	
	   $('#toolbar').find('li').eq(0).html('<a>'+$(this).text()+'<b class=""></b></a>');
	   catid = $(this).attr('id');//alert(this).
	   can_show = true; 
	   page = 1;
	   
	   $(".kouweidiv").hide();
	   defaultSwiper.refresh();
	   freshpage(); 
	   
   });
   $('#cuisienpx li').bind('click',function(){

		$('.kwselectedpx span').html( $(this).attr('catename') );
		
  
	   $(this).addClass('xz').siblings().removeClass('xz');
	   $('#toolbar').find('.se').removeClass('se');
	   $('#toolbar').find('.sh').removeClass('sh');
	   $('#supplierlist').html('');
	
	   $('#toolbar').find('li').eq(0).html('<a>'+$(this).text()+'<b class=""></b></a>');
	   order = $(this).attr('orderid');//alert(this).
	   can_show = true; 
	   page = 1;
	   
	   $(".kouweidivpx").hide();
	   defaultSwiper.refresh();
	   freshpage(); 
   });
   $('#cuisienqsj li').bind('click',function(){

		$('.kwselectedqsj span').html( $(this).attr('catename') );
		
  
	   $(this).addClass('xz').siblings().removeClass('xz');
	   $('#toolbar').find('.se').removeClass('se');
	   $('#toolbar').find('.sh').removeClass('sh');
	   $('#supplierlist').html('');
	
	   $('#toolbar').find('li').eq(0).html('<a>'+$(this).text()+'<b class=""></b></a>');
	   qsjid = $(this).attr('qsjid');//alert(this).
	   can_show = true; 
	   page = 1;
	   
	   $(".kouweidivqsj").hide();
	   defaultSwiper.refresh();
	   freshpage(); 
   }); 
}); 
 
function freshpage(){//刷新函数 
  page =1;
  pageend = false;
    $('#supplierlist').html(''); 
	var content = htmlback(siteurl+'/index.php?ctrl=wxsite&action=shoplistdata',{'typelx':'<{$typelx|default:0}>','areaid':'<{$areaid|default:0}>','search_input':search_input,'order':order,'catid':catid,'qsjid':qsjid,'page':page});
  	if(content.flag == false){
 	     $('#supplierlist').append(content.content);    
		 if(  $.trim(content.content) != '' && $("#supplierlist li").length >= 10  ){
 					$("#lodingmore").show();
		 } 
	}else{
	    Tmsg('xxxx');
	}  
	$('#loading').hide(); 
	hidefresh();
    //setTimeout("hidefresh()",50);  
}
function loadmore(){ 
	page = page+1;
	var content = htmlback(siteurl+'/index.php?ctrl=wxsite&action=shoplistdata',{'typelx':'<{$typelx|default:0}>','areaid':'<{$areaid|default:0}>','search_input':search_input,'order':order,'catid':catid,'qsjid':qsjid,'page':page});
		if(content.flag == false){
		$('#lodingmore .moreLoading i').addClass('iconstartloading');
	    $('#lodingmore .moreLoading i').removeClass('iconloading');
	    $('#lodingmore .moreLoading i').removeClass('iconOverload');
		$("#lodingmore span").text("上拉更多...");
		   var getmoreContent =  $.trim(content.content); 
  		   if( getmoreContent == ''  ){
 				pageend = true;
				$('#lodingmore .moreLoading i').removeClass('iconstartloading');
				$('#lodingmore .moreLoading i').removeClass('iconloading');
				$('#lodingmore .moreLoading i').addClass('iconOverload');
				$("#lodingmore span").text("加载完毕...");
		   }else{
				 $('#supplierlist').append(content.content);
		   }
		  
		}else{
			pageend = true;
			$('#lodingmore .moreLoading i').removeClass('iconstartloading');
			$('#lodingmore .moreLoading i').removeClass('iconloading');
	     	$('#lodingmore .moreLoading i').addClass('iconOverload');
			$("#lodingmore span").text("加载完毕...");
		}
		//  setTimeout("hideloadmore()",500);  
		hideloadmore();
	
} 

</script>
 <{if $open_wxcx == 1}>
	<style>
		.cx_maxh{max-height:40px;overflow:hidden;}
	.flipy {
		-moz-transform: scaleY(-1);
		-webkit-transform: scaleY(-1);
		-o-transform: scaleY(-1);
		transform: scaleY(-1);
		filter: FlipV();
	}
	</style>
	<script>
	function cx_maxh(){
		if($(".hoPaNearBot").hasClass("cx_maxh")){
			$(".hoPaNearBot").removeClass('cx_maxh');
			$(".fa-caret-down").addClass('flipy');
			defaultSwiper.refresh();
		}else{
			$(".hoPaNearBot").addClass('cx_maxh');
			$(".fa-caret-down").removeClass('flipy');
			defaultSwiper.refresh();
		}
	}
	</script>
	<{/if}>	
<{/block}>
<{block name=myScrolljs}>
  

<{/block}>
<{block name=sitetitle}><{$sitename}><{/block}>
<{block name=hearnav}>
<{if $wxType == 2 }>
<div class="toptitCon">
 <div class="toptitBox">
  <div class="toptitL"><a href="#"><i></i></a></div>
  <div class="toptitC"><h3><{if $shopshowtype == 'waimai' }>外卖<{/if}><{if $shopshowtype == 'market' }>超市<{/if}><{if $shopshowtype == 'dingtai' }>订台<{/if}>商家列表</h3></div>
  <div class="toptitR"><a href="#"><i class="search"></i></a></div>
 </div>
</div>
<{/if}>
<{/block}>
<{block name=blockcontent}> 

 <div class="caipinglist float_top" id="ucsss" style="position:fixed;z-index:1000; height:41px;">  

	<section>
		<div class="kouweixz">
			<div class="kwselected kouweiwx"><i class="sort01"></i><span>全部分类</span>&nbsp;<i class="fa fa-angle-down"></i></div>
			
		</div>
		<div class="kouweixzpx">
			<div class="kwselectedpx kouweiwxpx"><i class="sort02"></i><span>默认排序</span>&nbsp;<i class="fa fa-angle-down"></i></div>
			
		</div>
		<div class="kouweixzqsj" style="width:31%; border-right:0px;">
			<div class="kwselectedqsj kouweiwxqsj"><i class="sort03"></i><span>起送价</span>&nbsp;<i class="fa fa-angle-down"></i></div>
			
		</div>
	</section>


    </div>
	<!-- 全部分类 -->
	<div class="kouweidiv" id="wrappercate" style="height:60%;;<{if $wxType == 1 }>top:44px;<{/if}>">
					<div>
							<ul id="cuisien" class="lizd" > 
									<li catename="全部分类" id="0" class="xz"><a>全部</a></li>  
									<{foreach from=$caipin item=items}>
									 <li class="typeid_<{$items['id']}>" catename="<{$items['name']}>" id="<{$items['id']}>"><a><{$items['name']}></a></li>
									 <{/foreach}>
						 </ul> 
					</div>
	</div>
	
	
	<!-- 全部排序 -->
	<div class="kouweidivpx">
					<section>
							<ul id="cuisienpx" class="lizd" > 
									<li catename="默认" orderid="0" class=""><a>默认</a></li>  
									<li catename="距离" orderid="1" class=""><a>距离</a></li>  
									<li catename="起送价" orderid="2" class=""><a>起送价</a></li>  
									<li catename="推荐" orderid="3" class=""><a>推荐</a></li>  
									
						 </ul> 
					</section>
	</div>
	
		<!-- 起送价 -->
	<div class="kouweidivqsj">
					<section>
							<ul id="cuisienqsj" class="lizd" > 
									<li catename="不限" qsjid="0" class=""><a>不限起送价</a></li>  
									<li catename="低于5元" qsjid="1" class=""><a>低于5元</a></li>  
									<li catename="5元到10元" qsjid="2" class=""><a>5元到10元</a></li>  
									<li catename="10元以上" qsjid="3" class=""><a>10元以上</a></li> 									
						 </ul> 
					</section>
	</div>
	<script>
	
	

pulldowncate = new iScroll('wrappercate', { 
			hScrollbar:false, 
			vScrollbar:false,
			useTransition: true 
    	});
 
	
		$(".kouweixz").click(function(){
			$(".kouweidiv").toggle();
			$(".kouweidivpx").hide();
			$(".kouweidivqsj").hide();
			$(".kwselected").addClass('kouweiok').siblings().removeClass('kouweiok');
			pulldowncate.refresh();
			
		});
		$(".kouweixzpx").click(function(){
			$(".kouweidivpx").toggle();
			$(".kouweidivqsj").hide();
			$(".kouweidiv").hide();			
			$(".kwselectedpx").addClass('kouweiok').siblings().removeClass('kouweiok');
			
			
		});
			$(".kouweixzqsj").click(function(){
			$(".kouweidivqsj").toggle();
			$(".kouweidivpx").hide();
			$(".kouweidiv").hide();
			$(".kwselectedqsj").addClass('kouweiok').siblings().removeClass('kouweiok');
			
			
		});
	</script>
	

 <div id="wrapper" style="top:35px;<{if $wxType == 2 }>margin-top:40px;<{/if}>bottom:50px;  ">
	<div id="scroller">
	
		 <div class="nearbyreCon"> 
		 
		 	
	 <{if !empty($shopcateinfo) }>
		<div  style="width:100%;margin:0px;padding:0px;" >
 			<img onclick="dolink('<{$shopcateinfo['link']}>')" style="width:100%;margin:0px;padding:0px;" src="<{$shopcateinfo['img']}>" />
 		</div>
		<{/if}>
			
		 
 <div class=" homeNeashopBox ">
  <ul   id="supplierlist">
   
 
  </ul>
 </div>
		 

		 
		 </div>
		 
	  <div  id="lodingmore" style="background:#f0f0f0;display:none;"   class="downLoading "><div class="moreLoading"><i class="iconstartloading"></i><span>上拉更多...</span></div></div>

   

		
		
		 
   
   
</div>
</div>
<{/block}>